/*
 * @Date: 2025-11-07 17:19:31
 * @Auth: 873768511@qq.com
 * @LastEditors: 873768511@qq.com
 * @LastEditTime: 2025-11-10 16:59:25
 * @FilePath: \corpus\src\types\global.ts
 */

// 通用错误信息结果
interface IErrorExtraData {
  errorMsg: string;
  id: string;
}

// // 通用分页结果
// interface IPagination<T> {
//   current: number;
//   data: Array<T>;
//   pageSize: number;
//   total: number;
// }
// 通用返回结果
export interface IResult<T> {
  data: T;
  extraData: Array<IErrorExtraData>;
  errorCode: string;
  errorMsg: string;
  success: boolean;
  traceId: string;
}

// 带分页的通用返回结果
// export interface IPageResult0<T> extends IResult<IPagination<T>> { }
export interface IPageResult<T> {
  data: Array<T>;
  current: number;
  pageSize: number;
  total: number;
  extraData: Array<IErrorExtraData>;
  errorCode: string;
  errorMsg: string;
  success: boolean;
  traceId: string;
}
export interface IDeptTree {
  key: string;
  title: string;
  children?: IDeptTree[];
}

// 通用分页入参
export interface IPageRequest {
  current: number;
  pageSize: number;
}

export interface IEnums<T = string> {
  code: T;
  name: string;
}
